package com.calvin.study.config;

import org.springframework.boot.context.properties.ConfigurationProperties;
import org.springframework.stereotype.Component;

/**
 * 读取配置文件中的upload属性
 * 由于是静态变量，set方法使用static关键字修饰后，无法初始化。
 */
@Component
@ConfigurationProperties(prefix = "upload")
public class UploadConfig {

	private static String fileSaveDir;
	private static Integer fileMaxSize;

	public static String getFileSaveDir() {
		return fileSaveDir;
	}

	public void setFileSaveDir(String fileSaveDir) {
		UploadConfig.fileSaveDir = fileSaveDir;
	}

	public static Integer getFileMaxSize() {
		return fileMaxSize;
	}

	public void setFileMaxSize(Integer fileMaxSize) {
		UploadConfig.fileMaxSize = fileMaxSize;
	}

}
